package com.sohh.demo;

import java.util.Objects;

/**
 * @description: some desc
 * @author: ruoan
 * @date: 2021/2/21 15:57
 */
public class Fruits {
    private int id;
    private String name;
    private String description;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Fruits fruits = (Fruits) o;
        return id == fruits.id &&
                Objects.equals(name, fruits.name) &&
                Objects.equals(description, fruits.description);
    }

    @Override
    public int hashCode() {
        System.out.println("调用hash");
        return Objects.hash(id, name, description);
    }
}
